﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Webapi.EFCore.IRepository;
using Webapi.EFCore.Model.Enity;
using Webapi.EFCore.Repository.Base;
using Microsoft.EntityFrameworkCore;
using System.Linq;
using Webapi.EFCore.Model;

namespace Webapi.EFCore.Repository
{
    /// <summary>
    /// User 仓储 
    /// </summary>
    [Service]
    public class UserRepository : BaseRepository<User>, IUserRepository
    {
        public UserRepository(EFCoreDbContext efCoreDb) : base(efCoreDb)
        {
        }

        /// <summary>
        /// 获取用户数量
        /// </summary>
        /// <returns></returns>
        public async Task<int> GetCount()
        {
            var i = await EFCoreDb.User.CountAsync();
            return i;
        }

    }
}
